#include "widget.h"
#include "ui_widget.h"
#include <QStyle>
#include <QToolButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    layout = new QGridLayout(this);
    this->setLayout(layout);

    int count = QStyle::SP_LineEditClearButton + 1;
    for (int i = 0; i < count; i++)
    {
        QToolButton* btn = new QToolButton(this);
        btn->setIcon(this->style()->standardIcon(static_cast<QStyle::StandardPixmap>(i)));
        layout->addWidget(btn, i / 8, i % 8);
    }
}

Widget::~Widget()
{
    delete ui;
}

